<?php
if ( !defined( "IN_UCHOME" ) ) exit( "Access Denied" );
checklogin();
require('class.modify.php');
$mod = new modify($uid);
if(isset($_POST['myFormAc']) && $_POST['myFormAc'] == 'update'){
	$id = intval($_GET['id']);
	$mod->get_request();
	$mod->error('你的操作已经生效', 'action.php?ac=show&id=' . $id, 2, 1);
}else{
	$id = intval($_GET['id']);
	$data = $mod->get_data($id);
	if(empty($data)) showmessage("你要修改的活动已经不存在了", "action.php?ac=index", 2);

	$start = createDate($data['start_time']);
	$end = createDate($data['end_time']);

	realname_get();
	include_once( template( "action/view/add" ) );
}

function createDate($time)
{
	$temp = date('Y-n-j-G-i', $time);
	$start = explode('-', $temp);
	if(substr($start[4], 0, 1) == 0) $start[4] = substr($start[4], 1, 1);
	return $start;
}
?>